package com.experienceBaby.Cashbook.utils;

import com.experienceBaby.Cashbook.greendao.db.Recode;

import java.util.List;

public class CostUtils {
    public static int Count(List<Recode> datas) {
        int cost = 0;
        for (Recode recode : datas) {
            if (recode.getIncome() == 1) {
                cost -= recode.getCost();
            } else {
                cost += recode.getCost();
            }
        }
        return cost;
    }
}
